import React, { useEffect, useState } from 'react'
import { Swiper } from 'antd-mobile'
import { getSwiperList } from '../../request'
function MySwiper() {
    const [swiperList, setSwiperList] = useState([])
    useEffect(() => {
        getSwiperList().then(res => {
            setSwiperList(res.data.data)
        })
    }, [])
    return (
        <div>
            <Swiper autoplay={true}>
                {
                    swiperList.map((item, index) => {
                        return <Swiper.Item key={index}>
                            <img style={{ width: "100vw", height: '100px', border: '1px solid #00f' }} src={item.imgAlt} alt="" />
                        </Swiper.Item>
                    })
                }
            </Swiper>
        </div>
    )
}

export default MySwiper
